﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <title>AI销售</title>
    <link rel="stylesheet" type="text/css" href="../plugins/weui/css/weui.min.css">
    <link rel="stylesheet" type="text/css" href="../css/base.css">
    <link rel="stylesheet" type="text/css" href="../css/css.css">
    <link rel="stylesheet" type="text/css" href="../css/radar.css">
</head>
<body>
  <div class="container">
    <div class="weui-flex">
      <div class="weui-flex__item navbar">
          <a href="bossRadarIndex.html">
              <div class="placeholder">时间</div>
              <div class="border"></div>
          </a>
      </div>
      <div class="weui-flex__item navbar active_navbar">
          <a href="bossRadarSecond.html">
              <div class="placeholder">行为</div>
              <div class="border" style="display:block"></div>
              </a>
        </div>
      <div class="weui-flex__item navbar">
          <a href="bossRadarThree.html">
              <div class="placeholder">人</div>
              <div class="border"></div>
              </a>
        </div>
    </div>
    <div class="weui-tab__panel">
      <div>
        <div class="tongji">
          <div class="tongji-lft" style="padding-left:20px">
            7天内被查看的行为统计
          </div>
          <img src="../images/pk/50.png" alt="" style="padding-right:20px" class="choose-time">
        </div>
        <div class="detail-info">
          <div class="detail-info-items chkhref" data-id="0">
            <img class="detail-info-items-img" src="../images/pk/nav/25.png" alt="">
            <div class="check">
              <div class="">
                查看商品
              </div>
              <div class="Check0">
                  0次
              </div>
            </div>
          </div>
          <div class="detail-info-items chkhref" data-id="1">
            <img class="detail-info-items-img" src="../images/pk/nav/27.png" alt="">
            <div class="check">
              <div class="">
                查看官网
              </div>
              <div class="Check1">
                  0次
              </div>
            </div>
          </div>
          <div class="detail-info-items chkhref" data-id="2">
            <img class="detail-info-items-img" src="../images/pk/nav/26.png" alt="">
            <div class="check">
              <div class="">
                复制微信
              </div>
              <div class="Check2">
                  0次
              </div>
            </div>
          </div>
          <div class="detail-info-items chkhref" data-id="3">
            <img class="detail-info-items-img" src="../images/pk/nav/28.png" alt="">
            <div class="check">
              <div class="">
                转发名片
              </div>
              <div class="Check3">
                  0次
              </div>
            </div>
          </div>
        </div>
        <div class="weui-cell-other" style="background-color: #FAFAFA;">
          <div class="weui-cell chkhref" data-id="4">
            <div class="weui-cell__hd">
              <img src="../images/pk/nav/1.png" alt="" style="width:20px;margin-right:20px;display:block">
            </div>
            <div class="weui-cell__bd">
              <p>查看名片</p>
            </div>
            <div class="weui-cell__ft Check4" style="color:#fe7c08">0次</div>
          </div>
          <div class="weui-cell chkhref" data-id="5">
            <div class="weui-cell__hd">
              <img src="../images/pk/nav/2.png" alt="" style="width:20px;margin-right:20px;display:block">
            </div>
            <div class="weui-cell__bd">
              <p>查看动态</p>
            </div>
            <div class="weui-cell__ft Check5" style="color:#fe7c08">0次</div>
          </div>
          <div class="weui-cell chkhref" data-id="6">
            <div class="weui-cell__hd">
              <img src="../images/pk/nav/3.png" alt="" style="width:20px;margin-right:20px;display:block">
            </div>
            <div class="weui-cell__bd">
              <p>咨询产品</p>
            </div>
            <div class="weui-cell__ft Check6" style="color:#fe7c08">0次</div>
          </div>
          <div class="weui-cell chkhref" data-id="7">
            <div class="weui-cell__hd">
              <img src="../images/pk/nav/4.png" alt="" style="width:20px;margin-right:20px;display:block">
            </div>
            <div class="weui-cell__bd">
              <p>保存电话</p>
            </div>
            <div class="weui-cell__ft Check7" style="color:#fe7c08">0次</div>
          </div>
          <div class="weui-cell chkhref" data-id="8">
            <div class="weui-cell__hd">
              <img src="../images/pk/nav/5.png" alt="" style="width:20px;margin-right:20px;display:block">
            </div>
            <div class="weui-cell__bd">
              <p>觉得靠谱</p>
            </div>
            <div class="weui-cell__ft Check8" style="color:#fe7c08">0次</div>
          </div>
          <div class="weui-cell chkhref" data-id="9">
            <div class="weui-cell__hd">
              <img src="../images/pk/nav/6.png" alt="" style="width:20px;margin-right:20px;display:block">
            </div>
            <div class="weui-cell__bd">
              <p>拨打电话</p>
            </div>
            <div class="weui-cell__ft Check9" style="color:#fe7c08">0次</div>
          </div>
        </div>
      </div>
    </div>
    <div class="weui-tabbar tabbar">
      <a href="bossRadarIndex.html" class="weui-tabbar__item">
        <img src="../images/tabbar/9.png" alt="" class="weui-tabbar__icon">
        <p class="weui-tabbar__label" style="color:#FD4D01;">AI销售</p>
      </a>
        <a class="weui-tabbar__item a_msg_list">
            <img src="../images/tabbar/12.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">消息</p>
        </a>
      <a href="contactPerson.html" class="weui-tabbar__item">
        <img src="../images/tabbar/14.png" alt="" class="weui-tabbar__icon">
        <p class="weui-tabbar__label">客户</p>
      </a>
      <a href="friendState.html" class="weui-tabbar__item">
        <img src="../images/tabbar/16.png" alt="" class="weui-tabbar__icon">
        <p class="weui-tabbar__label">商圈</p>
      </a>
      <a href="myself.html" class="weui-tabbar__item">
        <img src="../images/tabbar/18.png" alt="" class="weui-tabbar__icon">
        <p class="weui-tabbar__label">我</p>
      </a>
    </div>
  </div>
  <div id="dialog1" style="display: none;">
    <div class="weui-mask"></div>
    <div class="weui-dialog">
      <div class="weui-dialog__hd">
        <strong class="weui-dialog__title">选择时间段</strong>
      </div>
      <div class="weui-dialog__bd">
        <div class="bd_input">
          <span id="startTime" style="margin-left:5px;"></span>
          <img src="../images/pk/50.png" alt="" onclick="startTime()">
        </div>
        <span class="bd_span">至</span>
        <div class="bd_input">
          <span id="endTime" style="margin-left:5px;"></span>
          <img src="../images/pk/50.png" alt="" onclick="endTime()">
        </div>
      </div>
      <div class="weui-dialog__ft">
        <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default" onclick="closeTime()">取消</a>
        <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" onclick="okTime()">确定</a>
      </div>
    </div>
  </div>
  <script type="text/javascript" src="../js/jquery-2.1.4.min.js"></script>
  <script type="text/javascript" src="../plugins/weui/js/weui.min.js"></script>
    <script src="../js/base.js"></script>
  <script type="text/javascript">
    var startTime1 = null;
    $(function () {
        loadBtn();        
        behavior(''); //雷达数据获取
    });

    function loadBtn() {
        //聊天会话链接
        $(".a_msg_list").click(function () {
            toUrl(siteUrlList.ImMessageList + "?uid=" + userid);
        });

        var index;
        $('.placeholder').on('click', function () {
            index = $(this).parents('.weui-flex__item').index()
            $(this).parents('.weui-flex__item').addClass('active_navbar').siblings().removeClass('active_navbar');
            $(this).parents().children('.border').css('display', 'block').parents().siblings().children('.border').css(
              'display', 'none')
            $('.weui-tab__panel').children().eq(index).css('display', 'block').siblings().css('display', 'none')
        });
        $('.choose-time').on('click', function () {
            $('#dialog1').css('display', 'block');
            /* Act on the event */
        });
        $('.chkhref').on('click', function () {
            window.location = "bossRadarFour.html?actiontype=" + $(this)[0].dataset['id'];
        });
    }

    function startTime() {
      $('#startTime').html("")
      $('#endTime').html("")
      weui.datePicker({
        start: '1990-01-01',
        end: new Date().getFullYear(),
        // onChange: function(result) {
        //
        // },
        onConfirm: function (result) {
          console.log(result);
          var startTime = [];
          for (var i = 0; i < result.length; i++) {
            startTime.push(result[i].value)
          }
          startTime = startTime.join("-");
          startTime1 = startTime;
          console.log(startTime);
          $('#startTime').html(startTime)
        }
      });
    };

    function endTime() {
      weui.datePicker({
        start: startTime1,
        end: new Date().getFullYear(),
        // onChange: function(result) {
        //
        // },
        onConfirm: function (result) {
          console.log(result);
          var endTime = [];
          for (var i = 0; i < result.length; i++) {
            endTime.push(result[i].value)
          }
          endTime = endTime.join("-");
          console.log(endTime);
          $('#endTime').html(endTime)
        }
      });
    };

    function closeTime() {
      $('#dialog1').css('display', 'none');
    }

    function okTime() {
        closeTime();
        var startTime = $('#startTime')[0].innerText;
        var endTime = $('#endTime')[0].innerText;
        for (i = 0; i < 10; i++)
            $('.Check' + i).html('0次');
        behavior('&startTime=' + startTime + '&endTime=' + endTime);
    }

    function checkEndTime(startTime,endTime){  
        var start=new Date(startTime.replace("-", "/").replace("-", "/")); 
        var end=new Date(endTime.replace("-", "/").replace("-", "/"));  
        if(end<start)
            return false;  
        return true;  
    } 

    function behavior(where) {
        ajaxGet(siteApiList.RadarList + '?staffid=' + staffId + where, function (res) {
            $.each(res.Data, function (index, item) {
                  $('.Check' + item.actionType).html(item.num + '次')
            });
        })
    }
  </script>
</body>

</html>